/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package dao.interfaces;

import engine.Edge;
import java.util.ArrayList;

/**
 * A data access object interface for edges.
 * @author Johnny
 */
public interface EdgeDao {
    /**
     * Returns the list of edges.
     * @return the list of edges.
     */
    public ArrayList<Edge> getEdges();

    /**
     * Adds an edge to the datasource.
     * @param startNodeId the id of it's start-node.
     * @param stopNodeId the id of it's stop-node.
     * @param colorRed the ammount of red from the color.
     * @param colorGreen the ammount of green from the color.
     * @param colorBlue the ammount of blue from the color.
     * @return the newly created edge.
     */
    public Edge addEdge(int startNodeId, int stopNodeId, int colorRed,
            int colorGreen, int colorBlue);

    /**
     * Removes an edge from the datasource.
     * @param edgeId the id of the edge to be removed.
     */
    public void removeEdge(int edgeId);

    /**
     * Updates the edge's attributes (color, start-node, stop-node) in the
     * datasource.
     * @param edge the edge that was modified.
     */
    public void updateEdge(Edge edge);

    /**
     * Adds a node to the edge's middle-nodes list.
     * @param edgeId the id of the edge that will be modified.
     * @param nodeId the id of the node that will be added.
     */
    public void addMiddleNode(int edgeId, int nodeId);

    /**
     * Removes a node from an edge's midde-nodes list.
     * @param edgeId the id of the edge that will be modified.
     * @param nodeId the id of the node that will be removed.
     */
    public void removeMiddleNode(int edgeId, int nodeId);
}
